//
//  NSPredicate.swift
//  Documentation
//
//  Created by Toj on 4/6/23.
//

https://www.jianshu.com/p/9f19a0842f52

@available(iOS 3.0, *)
open class NSPredicate : NSObject, NSSecureCoding, NSCopying {

    
    // Parse predicateFormat and return an appropriate predicate
    public init(format predicateFormat: String, argumentArray arguments: [Any]?)

    
    public init(format predicateFormat: String, arguments argList: CVaListPointer)

    
    public init(value: Bool) // return predicates that always evaluate to true/false

    
    @available(iOS 4.0, *)
    public init(block: @escaping (Any?, [String : Any]?) -> Bool)

    
    open var predicateFormat: String { get } // returns the format string of the predicate

    
    open func withSubstitutionVariables(_ variables: [String : Any]) -> Self // substitute constant values for variables

    
    open func evaluate(with object: Any?) -> Bool // evaluate a predicate against a single object

    
    @available(iOS 3.0, *)
    open func evaluate(with object: Any?, substitutionVariables bindings: [String : Any]?) -> Bool // single pass evaluation substituting variables from the bindings dictionary for any variable expressions encountered

    
    @available(iOS 7.0, *)
    open func allowEvaluation() // Force a predicate which was securely decoded to allow evaluation
}

extension NSPredicate {

    public convenience init(format predicateFormat: String, _ args: CVarArg...)
}
public struct _predicateFlags {

    public var _evaluationBlocked: UInt32

    public var _reservedPredicateFlags: UInt32

    public init()

    public init(_evaluationBlocked: UInt32, _reservedPredicateFlags: UInt32)
}

extension NSArray {

    open func filtered(using predicate: NSPredicate) -> [Any] // evaluate a predicate against an array of objects and return a filtered array
}

extension NSMutableArray {

    open func filter(using predicate: NSPredicate) // evaluate a predicate against an array of objects and filter the mutable array directly
}

extension NSSet {

    @available(iOS 3.0, *)
    open func filtered(using predicate: NSPredicate) -> Set<AnyHashable> // evaluate a predicate against a set of objects and return a filtered set
}

extension NSMutableSet {

    @available(iOS 3.0, *)
    open func filter(using predicate: NSPredicate) // evaluate a predicate against a set of objects and filter the mutable set directly
}

extension NSOrderedSet {

    
    @available(iOS 5.0, *)
    open func filtered(using p: NSPredicate) -> NSOrderedSet // evaluate a predicate against an ordered set of objects and return a filtered ordered set
}

extension NSMutableOrderedSet {

    
    @available(iOS 5.0, *)
    open func filter(using p: NSPredicate) // evaluate a predicate against an ordered set of objects and filter the mutable ordered set directly
}
